#include <iostream>
#include <cstdlib>

using namespace std;
struct A{
    ~A(){
        cout << "destruct A..." << endl;
    }
};

void closeDevice(){
    cout << "device is closing..." << endl;
}

int main(){
    A a;
    at_quick_exit(closeDevice);
    quick_exit(0);
}